package com.woniu.bank.service;

import com.woniu.bank.dto.AgreementGroupDTO;
import com.woniu.bank.dto.NewAgreementDTO;
import com.woniu.bank.entity.Agreement;
import com.woniu.bank.vo.AgreementDefaultDataVO;
import com.woniu.bank.vo.AgreementGroupMemberVO;
import com.woniu.bank.vo.AgreementGroupVO;

import java.util.List;

public interface AgreementService {
    int deleteByPrimaryKey(Long id);

    int insert(Agreement record);

    int insertSelective(Agreement record);

    Agreement selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(Agreement record);

    int updateByPrimaryKey(Agreement record);

    /**
     * 查询联保协议
     *
     * @param agreementGroupDTO 查询联保协议的条件
     * @return java.util.List<com.woniu.bank.vo.AgreementGroupVO>
     * @author 晨星
     * @date 2023/1/9 17:09
     **/
    List<AgreementGroupVO> select(AgreementGroupDTO agreementGroupDTO);

    /**
     * 查询联保协议对应的成员信息
     *
     * @param id 联保协议id
     * @return java.util.List<com.woniu.bank.vo.AgreementGroupMemberVO>
     * @author 晨星
     * @date 2023/1/9 17:10
     **/
    List<AgreementGroupMemberVO> selectGroupMember(Integer id);

    /**
     * 获取联保协议的默认数据
     *
     * @param agreement 联保协议视图类
     * @return com.woniu.bank.vo.AgreementDefaultDataVO
     * @author 晨星
     * @date 2023/1/9 17:05
     **/
    AgreementDefaultDataVO returnDefaultData(AgreementGroupVO agreement);

    /**
     * 签订联保协议
     *
     * @param agreement 联保协议
     * @return int
     * @author 晨星
     * @date 2023/1/9 21:13
     **/
    int insertAgreement(NewAgreementDTO agreement);

    /**
     * 终止联保协议
     *
     * @param agreement 联保协议
     * @return int
     * @author 晨星
     * @date 2023/1/9 21:41
     **/
    int terminationAgreement(AgreementGroupVO agreement);

    /**
     * 废弃联保协议
     *
     * @param agreement 联保协议
     * @return int
     * @author 晨星
     * @date 2023/1/9 21:41
     **/
    int cancellationAgreement(AgreementGroupVO agreement);
}
